import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    meta: {
      index: 1
    },
    component: () => import('@/views/Home/index.vue')
  },
  {
    path: '/detail',
    name: 'Detail',
    meta: {
      index: 2
    },
    component: () => import('@/views/Detail/index.vue')
  },
  {
    path: '/comment',
    name: 'Comment',
    meta: {
      index: 3
    },
    component: () => import('@/views/Comment/index.vue')
  },
  {
    path: "/:pathMatch(.*)*",
    redirect: { path: '/' }
  },
]

const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes
})

export default router
